//@description 公共校验规则
//@author wlj

const valRules = new Object();

valRules.title = '校验规则';

// 邮箱校验
valRules.email = /(^$)|^([a-zA-Z0-9]{1,63}|[a-zA-Z0-9][a-zA-Z0-9-_.]{0,62}[a-zA-Z0-9])@(([a-zA-Z0-9]+|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.){0,3}((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(net\.cn)|(org\.cn)|(name)|(biz)|(tv)|(cn)|(mobi)|(name)|(sh)|(ac)|(io)|(tw)|(com\.tw)|(hk)|(com\.hk)|(ws)|(travel)|(us)|(tm)|(la)|(me\.uk)|(org\.uk)|(ltd\.uk)|(plc\.uk)|(in)|(eu)|(it)|(jp))$/;

// 姓名校验：只能输入中/英文
valRules.name = /(^$)|^[\u4E00-\u9FA5A-Za-z]{2,15}$/;
// valRules.name = /^[^\n\r\u2028\u2029]{2,10}$/;

// 身份证校验
valRules.codeID = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;

// 手机号校验
valRules.moblie = /^1[3456789]\d{9}$/;

// 密码：只能数字或字母或组合
// valRules.passw = /(?!.*[\u4E00-\u9FA5\s])(?!^[a-zA-Z]+$)(?!^[\d]+$)(?!^[^a-zA-Z\d]+$)^.{6,12}$/
valRules.passw = /^[A-Za-z0-9]{6,12}$/;

export default valRules;